//请求统一管理
import requests from "@/api/requests";
import * as url from "url";

//用户登录
export const reqLoginByAdmin=(name,password)=>requests({url:`/admin/login?name=${name}&password=${password}`,method:'post'})
//退出登录
export const reqLogoutByAdmin=()=>requests({url:'/admin/logout',method:'post'})
//添加歌手
export const reqAddSinger=(params)=>requests({url:'/singer/add',method:'post',params})
//查询全部歌手
export const reqShowAllSinger=()=>requests({url:'/singer/showAll',method:'get'})
//保存编辑页面
export const reqUpdateSinger=(params)=>requests({url:'/singer/update',method:'post',params})
//删除歌手
export const reqDeleteSinger=(id)=>requests({url:`/singer/delete?id=${id}`,method:'post'})
//更新歌手图片
export const reqUpdateSingerPic=(params)=>requests({url:'/singer/updatePic',method:'post',params})
//根据名字模糊查询歌手
export const reqShowSingerByName=(name)=>requests({url:`/singer/showSingerByName?name=${name}`,method:'post'})
//根据名字查询id
export const reqShowSingerId=(name)=>requests({url:`/singer/selectToId?name=${name}`,method:'post'})





//查询歌曲
export const reqShowAllSong=()=>requests({url:'/song/findAll',method:'get'})
//添加歌曲
export const reqAddSong=(params)=>requests({url:'/song/addSong',method:'post',params})
//根据名字查询
export const reqShowByName=(name)=>requests({url:`/song/findByName?name=${name}`,method:'post'})
//删除歌曲
export const reqDeleteSong=(id)=>requests({url:`/song/deleteSong?id=${id}`,method:'post'})
//更新歌曲
export const reqUpdateSong=(params)=>requests({url:'/song/updateSong',method:'post',params})
//根据歌曲id查询歌曲
export const reqShowSongBySongId=(id)=>requests({url:`/song/findById?id=${id}`,method:'post'})
//根据歌名查询id
export const reqShowSongId=(name)=>requests({url:`/song/findToId?name=${name}`,method:'post'})





//查询Tencent关键字
export const reqShowTencentKey=()=>requests({url:'/tencent',method:'get'})




//查询全部歌单
export const reqShowAllSongList=()=>requests({url:'/songList/findAll',method:'get'})
//添加歌单
export const reqAddSongList=(params)=>requests({url:'/songList/addSongList',method:'post',params})
//编辑歌单
export const reqUpdateSongList=(params)=>requests({url:'/songList/updateSongList',method:'post',params})
//删除歌单
export const reqDeleteSongList=(id)=>requests({url:`/songList/deleteSongList?id=${id}`,method:'post'})





//查询该歌单中所有歌曲
export const reqShowAllSongListSong=(songListId)=>requests({url:`/listSong/findBySongListId?songListId=${songListId}`,method:'post'})
//添加歌单中的歌曲
export const reqAddSongListSong=(params)=>requests({url:'/listSong/addListSong',method:'post',params})
//删除歌单中的歌曲
export const reqDeleteSongListSong=(id)=>requests({url:`/listSong/deleteListSong?id=${id}`,method:'post'})





//查询所有用户
export const reqShowAllConsumer=()=>requests({url:'/consumer/findAll',method:'get'})
//添加用户
export const reqAddConsumer=(params)=>requests({url:'/consumer/addConsumer',method:'post',params})
//编辑用户
export const reqUpdateConsumer=(params)=>requests({url:'/consumer/updateConsumer',method:'post',params})
//删除用户
export const reqDeleteConsumer=(id)=>requests({url:`/consumer/deleteConsumer?id=${id}`,method:'post'})






//查询歌单中的评论
export const reqShowCommentInfo=(songListId)=>requests({url:`/comment/findBySongListId?songListId=${songListId}`,method:'post'})
//编辑评论
export const reqUpdateCommentInfo=(params)=>requests({url:'/comment/updateComment',method:'post',params})
//删除评论
export const reqDeleteCommentInfo=(id)=>requests({url:`/comment/deleteComment?id=${id}`,method:'post'})
//添加评论
export const reqAddCommentInfo=(params)=>requests({url:'/comment/addComment',method:'post',params})
